#!/bin/python3
# -*- coding:utf-8 -*-
"""
    [模块名]
    Add By :陈狍子 e4ting@qq.com 2024-07-23 17:38:58
"""
from e4ting  import util,log

from .config import ConfValue,ConfigParse

from .     import (
        CONF,
        WampSetting,
        FlaskConf,
        ConsulConf,
    )

if __name__ == '__main__':
    # ret = ConfigParse()

    # log.info(ret)
    # log.info(ret["database"].keys())
    # log.info(ret["database"]["REDIS_CELERY"])

    # log.info(ret["wamp"].keys())
    # log.info(ret["wamp"]["wamp_server"])

    # log.info(ret["consul"].keys())
    # log.info(ret["consul"]["token"])

    # log.info( "token" in ret["consul"])
    # log.info( "None" in ret["consul"])

    # log.info(ret["celery"].keys())

    log.info(CONF)
    util.printf([
        {"配置项":"CONF.REDIS_CELERY",   "值" : CONF.REDIS_CELERY},
        {"配置项":"CONF.MYSQL_HOSTNAME", "值" : CONF.MYSQL_HOSTNAME},
        {"配置项":"CONF.MYSQL_PORT",     "值" : CONF.MYSQL_PORT},
        {"配置项":"CONF.MYSQL_USERNAME", "值" : CONF.MYSQL_USERNAME},
        {"配置项":"CONF.MYSQL_PASSWORD", "值" : CONF.MYSQL_PASSWORD},
        {"配置项":"CONF.MONGO_HOSTNAME", "值" : CONF.MONGO_HOSTNAME},
        {"配置项":"CONF.REDIS_HOSTNAME", "值" : CONF.REDIS_HOSTNAME},
        {"配置项":"CONF.REDIS_CACHE",    "值" : CONF.REDIS_CACHE},
    ])

    log.info( WampSetting)
    util.printf([
        {"配置项":"WampSetting.wampserver", "值" : WampSetting.wampserver},
        {"配置项":"WampSetting.authid",     "值" : WampSetting.authid},
        {"配置项":"WampSetting.ticket",     "值" : WampSetting.ticket},
        {"配置项":"WampSetting.realm",      "值" : WampSetting.realm},
        {"配置项":"WampSetting.game_server","值" : WampSetting.game_server},
    ])

    log.info( FlaskConf)
    util.printf([
        {"配置项":"FlaskConf.FLASK_DB_URI",   "值": FlaskConf.FLASK_DB_URI},
        {"配置项":"FlaskConf.SECRET_KEY",     "值": FlaskConf.SECRET_KEY},
        {"配置项":"FlaskConf.CASDOOR_HOST",   "值": FlaskConf.CASDOOR_HOST},
        {"配置项":"FlaskConf.CASDOOR_ID",     "值": FlaskConf.CASDOOR_ID},
        {"配置项":"FlaskConf.CASDOOR_SECRET", "值": FlaskConf.CASDOOR_SECRET},
    ])

    log.info( ConsulConf)
    util.printf([
        {"配置项":"ConsulConf.CONSUL_URI",   "值": ConsulConf.CONSUL_URI},
        {"配置项":"ConsulConf.CONSUL_HOST",  "值": ConsulConf.CONSUL_HOST},
        {"配置项":"ConsulConf.CONSUL_TOKEN", "值": ConsulConf.CONSUL_TOKEN},
    ])
